package com.woniuxy.his.controller;


import com.woniuxy.his.common.Result;
import com.woniuxy.his.controller.form.AddPissCheckFrom;
import com.woniuxy.his.service.IPissCheckService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


import javax.annotation.Resource;

/**
 * <p>
 * 尿检表 前端控制器
 * </p>
 *
 * @author Lucas
 * @since 2021-08-28
 */
@RestController
//@RequestMapping("/his/piss-check")
@Slf4j
@CrossOrigin("*")
public class PissCheckController {
    @Resource
    private IPissCheckService pissCheckService;

    /**
     * 生成尿常规检查结果
     * @param addPissCheckFrom
     * @return
     */
    @PutMapping("/routineUrineTestformSubmission")
    public Result routineUrineTestformSubmission(@RequestBody AddPissCheckFrom addPissCheckFrom){

        log.info("尿常规检查结果前端传入参数：{}",addPissCheckFrom);

        Boolean pBoolean = pissCheckService.routineUrineTestformSubmission(addPissCheckFrom);

        return pBoolean ? Result.success("20000", "血常规结果生成成功！", null) : Result.fail("40004", "数据库繁忙！", null);
    }
}

